<style scoped>
.chart {
  height: 450px;
}
</style>


<template>
  <div>
    <z-pie-chart :def="def"></z-pie-chart>
    <vue-code-mirror :tpl="d.tpl" :js="d.js"></vue-code-mirror>
    <h3>基本setting参数</h3>
    <doc-props :data="doc.props"></doc-props>
  </div>
</template>

<script>
import ZPieChart from "@/zpkgs/components/z-chart/ZPieChart";
import VueCodeMirror from "@example/components/VueCodeMirror";
import DocProps from "@example/plugins/example/components/DocProps";

let o = {
  columns: ['渠道', '访问量'],
  rows: [
    ['直接访问', 320],
    ['邮件营销', 302],
    ['联盟广告', 334],
    ['视频广告', 390],
    ['搜索引擎', 330]
  ]
}
o.records = o.rows

export default {
  components: {
    DocProps,
    VueCodeMirror,
    ZPieChart,
  },
  provide: {
  },
  data() {
    return {
      def: o,
      doc: {
        props: [
          {
            name: 'def',
            type: 'Object',
            defVal: '{columns: [], records: []}',
            desc: '定义'
          }
        ]
      },
      d: {
        tpl: `
    <z-pie-chart :def="def"></z-pie-chart>
        `,
        js: `
def = {
  columns: ['渠道', '访问量'],
  records: [
    ['直接访问', 320],
    ['邮件营销', 302],
    ['联盟广告', 334],
    ['视频广告', 390],
    ['搜索引擎', 330]
  ]
}
        `
      }
    }
  },
  setup() {
    return {
    }
  }
}
</script>
